import json


class config:
    def __init__(self, path='config.conf'):
        from configparser import ConfigParser
        cp = ConfigParser()
        cp.read(path)
        self.cp = cp

    def get_TOKEN(self):
        # 获取TOKEN
        TOKEN = self.cp.get("bot", "TOKEN")
        if TOKEN == '':
            print("未填TOKEN")
            quit(0)
        else:
            return TOKEN

    def get_proxy(self):
        return self.cp.get("bot", "proxy")

    def get_pushTOKEN(self):
        return self.cp.get("bot", "pushTOKEN")

    def get_topic(self):
        return self.cp.get("bot", "topic")
